<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>修改密码</title>
    <!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/font-awesome/4.5.0/css/font-awesome.min.css" />

		<!-- page specific plugin styles -->

		<!-- text fonts -->
		<link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/fonts.googleapis.com.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />

		<link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace-rtl.min.css" />



		<!-- ace settings handler -->
		<script src="<%=request.getContextPath()%>/ace/assets/js/ace-extra.min.js"></script>

		<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

		<!--[if !IE]> -->
		<script src="<%=request.getContextPath()%>/ace/assets/js/jquery-2.1.4.min.js"></script>
		<!-- <![endif]-->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/static/jquery-validate/css/form.css" />
</head>
<body class="no-skin">
		<!-- /section:basics/content.breadcrumbs -->
	<div class="page-content">
		<!-- /section:settings.box -->
		<div class="page-content-area">
			<div class="page-header">
				<h1>
					修改密码
				</h1>
			</div>
			<!-- /.page-header -->
			<c:if test="${not empty msg}">
				<div id="myAlert" class="alert alert-warning">
					<a href="#" class="close" data-dismiss="alert">&times;</a>
					<strong>警告！</strong>${msg }。
				</div>
			</c:if>
			<div class="row">
				<div class="col-xs-12">
					<!-- PAGE CONTENT BEGINS -->
					<form class="form-horizontal" id="form" method="post">
						<!-- #section:elements.form -->
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 原密码 </label>
		
									<div class="col-sm-9">
										<input type="password" name="oldpwd" id="password" class="col-xs-10 col-sm-5" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-2"> 新密码 </label>
		
									<div class="col-sm-9">
										<input type="password" name="newpwd" id="newpwd" class="col-xs-10 col-sm-5" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-3"> 确认密码</label>
		
									<div class="col-sm-9">
										<input type="password" name="confirmpwd" id="confirmpwd" class="col-xs-10 col-sm-5" />
									</div>
								</div>
								
						<div class="clearfix form-actions">
							<div class="col-md-offset-3 col-md-9">
								<input type="submit" class="btn btn-primary" value="提交" />
								&nbsp; &nbsp; &nbsp;
								<input type="button" class="btn btn-info"  onclick="history.go(-1)" value="返回" />
							</div>
						</div>
					</form>

					<!-- PAGE CONTENT ENDS -->
				</div>
				<!-- /.col -->
			</div>
			<!-- /.row -->
		</div>
		<!-- /.page-content-area -->
	</div>
	<!-- /.page-content -->

</body>
<script src="<%=request.getContextPath()%>/static/jquery-validate/js/jquery.validate.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/static/jquery-validate/js/jquery.validate.extend.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/static/jquery-validate/js/additional-methods.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/ace/assets/js/bootbox.js"></script>
		<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/localization/messages_zh.js"></script>
		<script type="text/javascript">
		$().ready(function() {
			  $("#form").validate({
			    rules: {
			       	oldpwd: {
			    		required : true,
			    		remote : "<%=request.getContextPath()%>/user/checkOldpwd"
			    	},
			    	newpwd: {
				    	required : true,
				    	minlength: 5
			    	},
				    confirmpwd:{
				    	required : true,
				    	equalTo: "#newpwd"
				    }
			   },
			   messages: {
				   oldpwd:{
					   required: "请输入原密码",
					   remote:"原密码不正确"
				   }, 
				   newpwd: {
					   required : "请输入新密码",
				    	minlength: "新密码最少5个字符"
				   },
				   confirmpwd:{
					   required : "请输入确认密码",
				    	equalTo: "两次密码输入不一致"
				   }
			   },
			     });
			 });
	</script>
</html>